<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <h:form id="historicoSearch" styleClass="edit">
    
        <rich:simpleTogglePanel label="Historico search parameters" switchType="ajax">
        
        
        </rich:simpleTogglePanel>
        
        <div class="actionButtons">
            <h:commandButton id="search" value="Search" action="/HistoricoList.xhtml"/>
        </div>
        
    </h:form>
    
    <rich:panel>
        <f:facet name="header">Historico search results</f:facet>
    <div class="results" id="historicoList">

    <h:outputText value="No historico exists" 
               rendered="#{empty historicoList.resultList}"/>
               
    <rich:dataTable id="historicoList" 
                var="historico"
              value="#{historicoList.resultList}" 
           rendered="#{not empty historicoList.resultList}">
        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="idtHistorico #{historicoList.order=='idtHistorico asc' ? messages.down : ( historicoList.order=='idtHistorico desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{historicoList.order=='idtHistorico asc' ? 'idtHistorico desc' : 'idtHistorico asc'}"/>
                </s:link>
            </f:facet>
            #{historico.idtHistorico}
        </h:column>
        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="curso idtCurso #{historicoList.order=='curso.idtCurso asc' ? messages.down : ( historicoList.order=='curso.idtCurso desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{historicoList.order=='curso.idtCurso asc' ? 'curso.idtCurso desc' : 'curso.idtCurso asc'}"/>
                </s:link>
            </f:facet>
            #{historico.curso.idtCurso}
        </h:column>
        <h:column>
            <f:facet name="header">
                <s:link styleClass="columnHeader"
                             value="aluno idtAluno #{historicoList.order=='aluno.idtAluno asc' ? messages.down : ( historicoList.order=='aluno.idtAluno desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{historicoList.order=='aluno.idtAluno asc' ? 'aluno.idtAluno desc' : 'aluno.idtAluno asc'}"/>
                </s:link>
            </f:facet>
            #{historico.aluno.idtAluno}
        </h:column>
        <h:column>
            <f:facet name="header">action</f:facet>
            <s:link view="/#{empty from ? 'Historico' : from}.xhtml" 
                   value="Select" 
                      id="historico">
                <f:param name="historicoIdtHistorico" 
                        value="#{historico.idtHistorico}"/>
            </s:link>
        </h:column>
    </rich:dataTable>

    </div>
    </rich:panel>
    
    <div class="tableControl">
      
        <s:link view="/HistoricoList.xhtml" 
            rendered="#{historicoList.previousExists}" 
               value="#{messages.left}#{messages.left} First Page"
                  id="firstPage">
          <f:param name="firstResult" value="0"/>
        </s:link>
        
        <s:link view="/HistoricoList.xhtml" 
            rendered="#{historicoList.previousExists}" 
               value="#{messages.left} Previous Page"
                  id="previousPage">
            <f:param name="firstResult" 
                    value="#{historicoList.previousFirstResult}"/>
        </s:link>
        
        <s:link view="/HistoricoList.xhtml" 
            rendered="#{historicoList.nextExists}" 
               value="Next Page #{messages.right}"
                  id="nextPage">
            <f:param name="firstResult" 
                    value="#{historicoList.nextFirstResult}"/>
        </s:link>
        
        <s:link view="/HistoricoList.xhtml" 
            rendered="#{historicoList.nextExists}" 
               value="Last Page #{messages.right}#{messages.right}"
                  id="lastPage">
            <f:param name="firstResult" 
                    value="#{historicoList.lastFirstResult}"/>
        </s:link>
        
    </div>
    
    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/HistoricoEdit.xhtml"
                    id="create" 
                 value="Create historico">
            <f:param name="historicoIdtHistorico"/>
        </s:button>
    </s:div>
    
</ui:define>

</ui:composition>

